<template>
    <div class="container">
        <el-upload
            class="upload-demo"
            multiple
            :http-request="uploadAction"
        >
            <el-button type="primary">Click to upload</el-button>
        </el-upload>
    </div>
</template>
<script setup>
import axios from 'axios'
import {ref} from 'vue'
const uploadAction=(file)=>{
    console.log(file.file.name)
    const formData = new FormData();  
    formData.append('file', file.file);  
    axios({
        method:"post",
        url:'http://localhost:5000/upload',
        data:formData,
        headers:{
            'token':sessionStorage.getItem('token')
        }
    }).then(res=>{
        if(res.data.code==200){
           
        }
    }).catch(err=>{
       console.log(err)
    })
}
</script>
<style lang="scss" scoped>

</style>